import React from "react";
import "./Groupon.less";
import { Link, withRouter } from "react-router-dom";
import { Tabs } from "antd-mobile";
import { $pre } from "../../../../http/http";
import { filterPrice } from "../../../../filters";
import "./Groupon.less"
function Groupon(props) {
    let { groupon } = props;
    return (
      <div className="groupon">
        <Tabs
         defaultActiveKey="1"
         onChange={key=>{
         props.history.push("/list?id="+key)
        }}>
        </Tabs>
        {groupon.map((item) => {
            return (
              <Link className="groupon-shop" to={'/detail/'+item.id}  title={item.goodsname} key={item.id}>
               <img src={$pre + item.img} alt="" />
                <div>商品名称：{item.goodsname}</div>
                <div>价格：{filterPrice(item.price)}</div>
              </Link>
            );
          })}
       
      </div>
    );
  }
  export default withRouter(Groupon);